<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Registro de Usuario</title>
<link href="css/bootstrap-theme-3.0.0.css" rel="stylesheet" media="screen">



</head>
<body>

	  <!-- Static navbar -->
	  <div class="navbar navbar-default navbar-static-top">
	    <div class="container">
	      <div class="navbar-header">
	        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
	          <span class="icon-bar"></span>
	          <span class="icon-bar"></span>
	          <span class="icon-bar"></span>
	        </button>
	        <a class="navbar-brand" href="index.jsp">Principal</a>
	      </div>
	      <div class="navbar-collapse collapse">
	        <ul class="nav navbar-nav">
	          <li class="active"><a href="principal.jsp">Inicio</a></li>
	          <li class="dropdown">
	            <a href="#" class="dropdown-toggle" data-toggle="dropdown">Mantenimientos <b class="caret"></b></a>
	            <ul class="dropdown-menu">
	              
	              <li><a href="UsuarioBuscarServlet">Usuarios</a></li>
	              <li><a href="CategoriaBuscarServlet">Categorias</a></li>
	            </ul>
	          </li>
	          <li><a href="#">Reportes</a></li>	          
	          <li><a href="LogoutServlet">Salir</a></li>
	        </ul>
	      </div><!--/.nav-collapse -->
	    </div>
	  </div>
	
	<div style="padding: 10px; margin:0 auto; width: 600px;">
      
      <form class="form-horizontal" role="form" action="UsuarioInsertarServlet" method="post">
        <fieldset class="control-group error">
          <legend>Datos de usuario</legend>
          <div class="form-group">
            <label for="cbxTipoUsuario" class="col-sm-4 control-label">Tipo de usuario (*)</label>
            <div class="col-sm-8">
              <select class="form-control" id="cbxTipoUsuario" name="tipoUsuario">                
        		<option value=0>Seleccione usuario</option>
        		<%@page import="java.util.Collection, pascal.modelo.TipoUsuario"%>
        			<% 
        			Collection<TipoUsuario> tipoUsuario = (Collection<TipoUsuario>)request.getSession().getAttribute("TIPO_USUARIO");
        			if ( tipoUsuario!= null)
        				for (TipoUsuario tu:tipoUsuario){
        			%>
        			<option value=<%=tu.getCodTipoUsuario()%> > <%=tu.getNombreTipoUsuario()%></option>
        		<%}%>
              </select>
            </div>
          </div>
          <div class="form-group">
            <label for="inputNombres" class="col-sm-4 control-label">Nombres (*)</label>
            <div class="col-sm-8">
              <input type="text" class="form-control" id="inputNombres" name="nombre" placeholder="Ingrese nombre completo">
            </div>
          </div>
          <div class="form-group">
            <label for="inputApellidoPaterno" class="col-sm-4 control-label">Apellido paterno (*)</label>
            <div class="col-sm-8">
              <input type="text" class="form-control" name="apellidoPaterno" id="inputApellidoPaterno" placeholder="Ingrese apellido paterno">
            </div>
          </div>
          <div class="form-group">
            <label for="inputApellidoMaterno" class="col-sm-4 control-label">Apellido materno (*)</label>
            <div class="col-sm-8">
              <input type="text" class="form-control" id="inputApellidoMaterno" name="apellidoMaterno" placeholder="Ingrese apellido materno">
            </div>
          </div>
          <div class="form-group">
            <label for="cbxSexo" class="col-sm-4 control-label">Sexo (*)</label>
            <div class="col-sm-8">
              <div class="radio">
                <label>
                  <input type="radio" name="sexo" id="optionsRadios1" value="M" checked>
                  Masculino
                </label>
              </div>
              <div class="radio">
                <label>
                  <input type="radio" name="sexo" id="optionsRadios2" value="F">
                  Femenino
                </label>
              </div>
            </div>
          </div>
          <div class="form-group">
            <label for="cbxDocumentoIdentidad" class="col-sm-4 control-label">Documento identidad (*)</label>
            <div class="col-sm-8">              
              <select class="form-control" name="tipDocumento" id="cbxDocumentoIdentidad">
        		<option value=0>Seleccione tipo de documento</option>
        			<%@page import="java.util.Collection, pascal.modelo.TipoDocumento"%>
        				<% Collection<TipoDocumento> tipoDocumento = (Collection<TipoDocumento>)request.getSession().getAttribute("TIPO_DOCUMENTO");
        					if ( tipoDocumento!= null)
        						for (TipoDocumento td:tipoDocumento){%>
        							<option value=<%=td.getCodTipoDocumento()%>><%=td.getNombreTipoDocumento()%>
        							</option>
        			<%}%>
        	  </select>
            </div>
          </div>
          <div class="form-group">
            <label for="inputNumeroDocumento" class="col-sm-4 control-label">Numero documento (*)</label>
            <div class="col-sm-8">
              <input type="text" class="form-control" id="inputNumeroDocumento" placeholder="Ingrese numero de documento" name="numDocumento">
            </div>
          </div>
          <div class="form-group">
            <label for="inputEmail" class="col-sm-4 control-label">Email (*)</label>
            <div class="col-sm-8">
              <div class="input-group">
                <span class="input-group-addon">@</span>
                <input type="text" id="inputEmail" class="form-control" placeholder="Ingrese email" name="correo">
              </div>
            </div>
          </div>
          <div class="form-group">
            <label for="inputCelular" class="col-sm-4 control-label">Celular</label>
            <div class="col-sm-5">
              <input type="tel" class="form-control" id="inputCelular" placeholder="Ingrese numero celular" name="celular">
            </div>
          </div>
          <div class="form-group">
            <label for="inputFechaNacimiento" class="col-sm-4 control-label">Fecha nacimiento</label>
            <div class="col-sm-4">
              <input type="date" class="form-control" id="inputFechaNacimiento" placeholder="" name="fechaNacimiento">
            </div>
          </div>
          <div class="form-group">
            <label for="inputUsername" class="col-sm-4 control-label">Username (*)</label>
            <div class="col-sm-8">
              <input type="text" class="form-control" id="inputUsername" placeholder="Ingrese username" name="usuario">
            </div>
          </div>
          <div class="form-group">
            <label for="inputPassword3" class="col-sm-4 control-label">Password (*)</label>
            <div class="col-sm-8">
              <input type="password" class="form-control" id="inputPassword3" placeholder="Ingrese password de maximo 12 digitos" name="clave">
            </div>
          </div>
          <div class="form-group">
            <label for="inputPassword3" class="col-sm-4 control-label"></label>
            <div class="col-sm-8">
              <button type="submit" class="btn btn-primary">Registrar</button>
              <button type="button" class="btn btn-danger">Cancelar</button>
            </div>
          </div>
        </fieldset>
      </form>

    </div>


	<script src="js/jquery-1.10.2.js"></script>
	<script src="js/bootstrap-3.0.0.js"></script>

</body>
</html>